<% content_for :css do %>
  <%= stylesheet_link_tag 'my_peer_prices.css' %>  
<% end %>
<% content_for :title do %> <%= @enterprise.name %>的报价<% end %>
<div id="my_peer_prices" class='grid_18 omega'>
  <div class="grid_18 alpha head">
    <div class="title">
      <h6>
        <span>
        <%= @enterprise.name %>『<%= params[:released_on] %>』的<%= t params[:type_name] %>报价
        </span>
        <%#= link_to '删除','', :class => 'crud_in_h6 l_crud l_delete' %>
      </h6>
    </div>
  </div>
  <div id="peer_prices" class='grid_18  alpha'>
    <div class='tabs_bar'>
      <div class="tabs">
        <div>
          <%= link_to enterprise_peer_prices_url(:enterprise_id => @enterprise, :type_name => :cpu), :class => (params[:type_name] == 'cpu' ? 'tab h' : 'tab') do %>
            CPU (<b><%= PeerPrice.where(:enterprise_id => @enterprise, :released_on => params[:released_on]).cpu.released.count %></b>)
          <% end %>
          <%= link_to enterprise_peer_prices_url(:enterprise_id => @enterprise, :type_name => :memory), :class => (params[:type_name] == 'memory' ? 'tab h' : 'tab') do %>
            <%= t :memory %> (<b><%= PeerPrice.where(:enterprise_id => @enterprise, :released_on => params[:released_on]).memory.released.count %></b>)
          <% end %>
          <%= link_to enterprise_peer_prices_url(:enterprise_id => @enterprise, :type_name => :hard_disk), :class => (params[:type_name] == 'hard_disk' ? 'tab h' : 'tab') do %>
            <%= t :hard_disk %> (<b><%= PeerPrice.where(:enterprise_id => @enterprise, :released_on => params[:released_on]).hard_disk.released.count %></b>)
          <% end %>
        </div>
      </div>
      <div class="tools">

      </div>
    </div>
    <div class="all_peer_prices">
      <%= render :partial => 'peer_prices.html', :locals => { :peer_prices => @peer_prices, :enterprise => @enterprise } %>
    </div>
  </div>
</div>
<div id="right" class='grid_6 alpha omega'>
  <div class="about_enterprise">
    <h6><%= current_enterprise.name %></h6>
    <dl class="block">
      <dt>公司简介</dt>
      <dd><%= @enterprise.synopsis %> </dd>
    </dl>
    <dl class="block">
      <dt>联系方式</dt>
      <dd>地址：<%= @enterprise.address %></dd>
      <dd>电话：<%= @enterprise.link_phone %></dd>
      <dd>传真：<%= @enterprise.fax %></dd>
      <dd>电邮：<%= link_to @enterprise.email,"mailto:#{@enterprise.email}" %></dd>
    </dl>
    <% if @enterprise.qqs.any? %>
    <dl class="block">
      <dt>客服QQ</dt>
      <% @enterprise.qqs.each_with_index do |qq,index| %>
      <dd class="qq">
        <a title="点击这里给我发消息" href="http://wpa.qq.com/msgrd?v=3&amp;uin=<%= qq %>&amp;site=qq&amp;menu=yes" target="_blank"><img border="0" src="http://wpa.qq.com/pa?p=2:<%= qq %>:45"><%= index + 1 %>号</a>
      </dd>
      <% end %>
    </dl>
    <% end %>
  </div>
  <div class="grid_6 alpha" id="stats">
    <h6>今日存货</h6>
    <div class="all">
      <div class='sub_title'>CPU</div>
      <div class="stat">
        <%= link_to enterprise_peer_prices_url(:enterprise_id => @enterprise,:stock_situation => :full, :type_name => :cpu) do %>
          <b class="news full"><%= t :full %></b>
          <span><%= PeerPrice.where(:enterprise_id => @enterprise,:released_on => params[:released_on]).cpu.full.count %></span>      
        <% end %>
      </div>
      <% if PeerPrice.where(:enterprise_id => @enterprise,:released_on => params[:released_on]).cpu.shortage.any? %>
      <div class="stat">
        <%= link_to enterprise_peer_prices_url(:enterprise_id => @enterprise,:stock_situation => :shortage, :type_name => :cpu) do %>
          <b class="news shortage"><%= t :shortage %></b>
          <span><%= PeerPrice.where(:enterprise_id => @enterprise,:released_on => params[:released_on]).cpu.shortage.count %></span>      
        <% end %>
      </div>
      <% end %>
      <% if PeerPrice.where(:enterprise_id => @enterprise,:released_on => params[:released_on]).cpu.paused.any? %>
      <div class="stat">
        <%= link_to enterprise_peer_prices_url(:enterprise_id => @enterprise,:status => :paused, :type_name => :cpu) do %>
          <b class="news paused"><%= t :paused %></b>
          <span><%= PeerPrice.where(:enterprise_id => @enterprise,:released_on => params[:released_on]).cpu.paused.count %></span>      
        <% end %>
      </div>
      <% end %>
    </div>  
    <div class="all">
      <div class='sub_title'><%= t :memory %></div>
      <div class="stat">
        <%= link_to enterprise_peer_prices_url(:enterprise_id => @enterprise,:stock_situation => :full, :type_name => :memory) do %>
          <b class="news full"><%= t :full %></b>
          <span><%= PeerPrice.where(:enterprise_id => @enterprise,:released_on => params[:released_on]).memory.full.count %></span>      
        <% end %>
      </div>
      <% if PeerPrice.where(:enterprise_id => @enterprise,:released_on => params[:released_on]).memory.shortage.any? %>
      <div class="stat">
        <%= link_to enterprise_peer_prices_url(:enterprise_id => @enterprise,:stock_situation => :shortage, :type_name => :memory) do %>
          <b class="news shortage"><%= t :shortage %></b>
          <span><%= PeerPrice.where(:enterprise_id => @enterprise,:released_on => params[:released_on]).memory.shortage.count %></span>      
        <% end %>
      </div>
      <% end %>
      <% if PeerPrice.where(:enterprise_id => @enterprise,:released_on => params[:released_on]).memory.paused.any? %>
      <div class="stat">
        <%= link_to enterprise_peer_prices_url(:enterprise_id => @enterprise,:status => :paused, :type_name => :memory) do %>
          <b class="news paused"><%= t :paused %></b>
          <span><%= PeerPrice.where(:enterprise_id => @enterprise,:released_on => params[:released_on]).memory.paused.count %></span>      
        <% end %>
      </div>
      <% end %>
    </div> 
    <div class="all">
      <div class='sub_title'><%= t :hard_disk %></div>
      <div class="stat">
        <%= link_to enterprise_peer_prices_url(:enterprise_id => @enterprise,:stock_situation => :full, :type_name => :hard_disk) do %>
          <b class="news full"><%= t :full %></b>
          <span><%= PeerPrice.where(:enterprise_id => @enterprise,:released_on => params[:released_on]).hard_disk.full.count %></span>      
        <% end %>
      </div>
      <% if PeerPrice.where(:enterprise_id => @enterprise,:released_on => params[:released_on]).hard_disk.shortage.any? %>
      <div class="stat">
        <%= link_to enterprise_peer_prices_url(:enterprise_id => @enterprise,:stock_situation => :shortage, :type_name => :hard_disk) do %>
          <b class="news shortage"><%= t :shortage %></b>
          <span><%= PeerPrice.where(:enterprise_id => @enterprise,:released_on => params[:released_on]).hard_disk.shortage.count %></span>      
        <% end %>
      </div>
      <% end %>
      <% if PeerPrice.where(:enterprise_id => @enterprise,:released_on => params[:released_on]).hard_disk.paused.any? %>
      <div class="stat">
        <%= link_to enterprise_peer_prices_url(:enterprise_id => @enterprise,:status => :paused, :type_name => :hard_disk) do %>
          <b class="news paused"><%= t :paused %></b>
          <span><%= PeerPrice.where(:enterprise_id => @enterprise,:released_on => params[:released_on]).hard_disk.paused.count %></span>      
        <% end %>
      </div>
      <% end %>
    </div> 
  </div>
  <div class="grid_6 alpha" id="supports">
    <h6>在线支持</h6>
    <div>
      <a title="点击这里给我发消息" href="http://wpa.qq.com/msgrd?v=3&amp;uin=7861848&amp;site=qq&amp;menu=yes" target="_blank"><img border="0" src="http://wpa.qq.com/pa?p=2:7861848:45">一号</a>
    </div>
    <div>
      <a title="点击这里给我发消息" href="http://wpa.qq.com/msgrd?v=3&amp;uin=151430712&amp;site=qq&amp;menu=yes" target="_blank"><img border="0" src="http://wpa.qq.com/pa?p=2:151430712:45">二号</a>
    </div>
  </div>
</div>  